package com.amrit.revision;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;

public class CollectionTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//HashMap
		HashMap<Object, Object> hm = new HashMap<Object, Object>();
		hm.put(new String("ABC"), "abc");
		hm.put("ABC", "def");
		//LinkedList
		System.out.println(hm);
		LinkedList<Object> ll = new LinkedList<Object>();
		ll.add(hm);
		ll.add("String1");
		ll.add(0, "First");
		ll.add("String2");
		ll.add(0, "Second");
		ll.add("String3");
		ll.add(0, "Third");
		ll.add("String4");
		ll.add(0, "Fourth");
		System.out.println("Last "+ll.getLast());
		System.out.println("First "+ll.getFirst());
		System.out.println(ll);
		//ArrayList
		ArrayList<String> al = new ArrayList<String>();
		al.add("A");
		al.add("b");
		System.out.println(al.hashCode());
		
	}

}